<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>

    // function fn (a) {
    //   // 默认值处理
    //   a = a || '默认值'
    //   console.log(a)
    // }
    // fn()


    function fn (a = '默认值') {
      // 如果调用函数没有传参a，那么a的值默认就是 = 后的值
      console.log(a)
    }  
    fn()


  </script>
</body>
</html>